//
//  FTLocationViewController.m
//  项目2
//
//  Created by rimi on 16/8/19.
//  Copyright © 2016年 wzc. All rights reserved.
//

#import "FTLocationViewController.h"
#import "FTConfigDefine.h"
#import "FTSearchBar.h"
#import "Masonry.h"
#import "UINavigationBar+FTNavi.h"
#import "UIButton+FTButton.h"

@interface FTLocationViewController ()<UISearchBarDelegate>
@property (strong, nonatomic) UISearchBar *searchBar;
@end

@implementation FTLocationViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    [self.navigationController.navigationBar setWhiteTintColor];
    self.title = @"选择城市";
 
    
    [self addSearchBar];
}
-(void)addSearchBar{
    [self.view addSubview:self.searchBar];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
-(void)viewDidLayoutSubviews{
    [super viewDidLayoutSubviews];
    [_searchBar mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_equalTo(self.view.mas_centerX);
        make.centerY.equalTo(self.view.mas_top).with.offset(100);
        make.left.equalTo(self.view.mas_left).with.offset(10);
        make.right.equalTo(self.view.mas_right).with.offset(-10);
        make.height.mas_equalTo(44);
    }];
}
-(UISearchBar *)searchBar{
    if (!_searchBar) {
//        _searchBar = [[FTSearchBar alloc]initWithFrame:CGRectMake(10, 100,kScreenWidth-20 , 30*kScreenHeightScale)];
        _searchBar = [[FTSearchBar alloc]init];
        _searchBar.center = CGPointMake(kScreenWidth/2, 100);
        _searchBar.backgroundColor = [UIColor whiteColor];
        _searchBar.placeholder = @"城市/拼音";
        _searchBar.delegate = self;
        _searchBar.layer.borderWidth = 1;
        _searchBar.layer.borderColor = [UIColor grayColor].CGColor;
        _searchBar.layer.cornerRadius = 5;
    }
    return _searchBar;
}
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
